// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  const db = cloud.database()
  const _ = db.command
  db.collection('user').where({
    user_id:event.id
  }).update({
    data: {
      nums:_.inc(-1)
    },
    success: function(res) {
      console.log(res.data)
    }
  })
  return {
  }
}